package com.pingan.cloud.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.pingan.cloud.dto.User;
import com.pingan.cloud.service.UserService;

@RestController
public class UserController {

	@Autowired
	private UserService userService;
	
	@GetMapping("/simple/{id}")
	public User findById(@PathVariable Integer id) {
		return this.userService.findById(id);
	}
	
	@RequestMapping("/getUsers")
    public List<User> getUsers(){
        return userService.findAll();
    }

}
